<!-- 教学管理-班级学生-学生一卡通 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-left">
      <div class="JNPF-common-title">
        <h2>班级树</h2>
        <span class="options">
          <el-tooltip content="班级树" placement="top">
            <el-link icon="el-icon-menu" :underline="false"/>
          </el-tooltip>
        </span>
      </div>

      <el-scrollbar class="JNPF-common-el-tree-scrollbar">
        <el-tree :props="defaultProps"
              accordion :data="treeData"  node-key="id" default-expanded-keys="[1,1]"
          class="JNPF-common-el-tree">
          <span class="custom-tree-node" slot-scope="{ data }">
            <i :class="data.icon" />
            <span class="text">{{data.label}}</span>
          </span>
        </el-tree>
      </el-scrollbar>
    </div>

    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="8">
            <el-form-item label="学生学籍号">
                <el-input v-model="FNUM" placeholder="请输入学生学籍号" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="学生姓名">
             <el-input v-model="FCATNAME" placeholder="请输入学生姓名" clearable />
            </el-form-item>
          </el-col>

          <template v-if="showAll">
            <el-col :span="6">
            <el-form-item label="所属学院">
              <el-select v-model="keyword" placeholder="请选择">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属专业">
              <el-select v-model="keyword" placeholder="请选择">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="性别">
               <el-select v-model="keyword" placeholder="请选择">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="手机号码">
              <el-input v-model="keyword" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="状态">
              <el-select v-model="keyword" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          </template>
          <el-col :span="8">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="warning" icon="el-icon-upload2">批量上传</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>

      <!-- <div class="JNPF-common-layout-main JNPF-flex-main">
        <div class="JNPF-common-head">
          <topOpts  :addText="$t('common.addBtn')">
            <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
          </topOpts>
          <div class="JNPF-common-head-right">
            <screenfull />
          </div>
        </div> -->

        <JNPF-table v-loading="listLoading" :data="list">
          <el-table-column prop="FPARENTNO" label="所属年级" ></el-table-column>
          <el-table-column prop="FCLASS" label="所属班级"></el-table-column>
          <el-table-column prop="FCATNO" label="学籍号" ></el-table-column>
          <el-table-column prop="FCATNAME" label="学生姓名"></el-table-column>
          <el-table-column prop="FCARD1" label="IC卡1"></el-table-column>
          <el-table-column prop="FCARD2" label="IC卡2"></el-table-column>
          <el-table-column fixed="left" label="操作" width="125">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                发卡
              </el-button>
              <el-popconfirm title="确定回收当前卡片吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">回收</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.currentPage"  :limit.sync="listQuery.pageSize" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
import Form from "./Form.vue"
export default {
  name: 'base05',
  components: { Form },
  data() {
    return {
      keyword: '',
      showAll:false,
      list: [],
      statelist:[
        {value:0,label:"全部"}
        ,{value:1,label:"未审核"}
        ,{value:2,label:"已审核"}
      ],
      defaultProps: {
        children: 'children',
        label: 'label'
      },

      options1: [{
          value: 'L001',
          label: '化学与材料科学学院'
        }, {
          value: 'L002',
          label: '生命科学学院'
        }],

     options4: [{
          value: 'L001',
          label: '已录入'
        }, {
          value: 'L002',
          label: '未录入'
        }],

      treeData: [{
          label: "化学系",
          children: [{
            label: "大一",
            children: [{
              label: "24级化学系1班"
            },{
              label: "24级化学系2班"
            },{
              label: "24级化学系3班"
            }]
          },{
            label: "大二",
            children: [{
              label: "23级化学系1班"
            },{
              label: "23级化学系2班"
            },{
              label: "23级化学系3班"
            }]
          }]
        }, {
          label: "化工与材料系",
          children: [{
            label: "大一",
            children: [{
              label: "24级化工与材料系1班"
            },{
              label: "24级化工与材料系2班"
            },{
              label: "24级化工与材料系3班"
            }]
          },{
            label: "大二",
            children: [{
              label: "23级化工与材料系1班"
            },{
              label: "23级化工与材料系2班"
            },{
              label: "23级化工与材料系3班"
            }]
          }]
        }, {
          label: "分析测试中心",
          children: [{
            label: "大一",
            children: [{
              label: "24级分析测试中心1班"
            },{
              label: "24级分析测试中心2班"
            },{
              label: "24级分析测试中心3班"
            }]
          },{
            label: "大二",
            children: [{
              label: "23级分析测试中心1班"
            },{
              label: "23级分析测试中心2班"
            },{
              label: "23级分析测试中心3班"
            }]
          }]
        }],

      list: [
        {
          "FYEAR": 2024,
          "FPARENTNO": "大一",
          "FCLASS":"24级化学系1班",
          "FCATNO": "241001",
          "FCATNAME": "曹操",
          "FCARD1":"0887831278",
          "FCARD2":"-",
          "FSEX": "男",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FYEAR": 2024,
          "FPARENTNO": "大一",
          "FCLASS":"24级化学系1班",
          "FCATNO": "241002",
          "FCATNAME": "刘备",
          "FCARD1":"0887831278",
          "FCARD2":"-",
          "FSEX": "男",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FYEAR": 2023,
          "FPARENTNO": "大二",
          "FCLASS":"23级化学系1班",
          "FCATNO": "242001",
          "FCATNAME": "小乔",
          "FCARD1":"0887831278",
          "FCARD2":"-",
          "FSEX": "女",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],
      total: 0,
      listLoading: false,
      listQuery: {
        currentPage: 1,
        pageSize: 20,
        sort: 'desc',
        sidx: '',
        createdate:[new Date(),new Date()],
        ordstate:undefined,
        auditingdate:[new Date(),new Date()]
      },
      formVisible: false
    }
  },
  created() {
  },
  methods: {
   initData(){
    console.log("initData")
   },
   insert(row) {
        this.$refs.Form.init(row);
      },
  }
}
</script>